package com.yootk.listener;

import jakarta.servlet.annotation.WebListener;
import jakarta.servlet.http.HttpSessionEvent;
import jakarta.servlet.http.HttpSessionListener;

/**
 * HttpSession状态监听
 */
//@WebListener
public class SessionStateMonitor implements HttpSessionListener {

    @Override
    public void sessionCreated(HttpSessionEvent se) {
        System.out.println("【SessionStateMonitor.sessionCreated()】SessionID = " + se.getSession().getId());
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        System.out.println("【SessionStateMonitor.sessionDestroyed()】SessionID = " + se.getSession().getId());
    }
}
